package com.itcat.api;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.itcat.api.mysql.UmsMemberLevelApi;
import com.itcat.mapper.UmsMemberLevelMapper;
import com.itcat.mysql.pojo.UmsMemberLevel;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

/**
 * @author Jerry Broker
 * @project_name rainbow-mall
 * @create 2022-04-03 15:30
 */
@DubboService
public class UmsMemberLevelApiImpl implements UmsMemberLevelApi {

    @Autowired
    private UmsMemberLevelMapper umsMemberLevelMapper;

    /**
     * 查询所有会员等级
     * @param defaultStatus
     * @return
     */
    @Override
    public List<UmsMemberLevel> list(Integer defaultStatus) {
        LambdaQueryWrapper<UmsMemberLevel> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(UmsMemberLevel::getDefaultStatus , defaultStatus);
        List<UmsMemberLevel> list = umsMemberLevelMapper.selectList(queryWrapper);
        return list;
    }
}
